package lily.com.app;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
import android.util.Log;
import android.view.View;

public class GuideSwipeGestureResponder implements GestureResponder {
	
	private Class<?> prevous = null;
	private Class<?> next = null;
	
	public GuideSwipeGestureResponder(Class<?> previous, Class<?> next){
//		Log.d("DEBUG","GuideSwipeGestureResponder constructor");
		this.prevous = previous;
		this.next = next;
	}

	@Override
	public void onClick(View v, Point event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void startSwipeRight(View v, Point fromEvent, Point toEvent) {
//		Log.d("DEBUG","GuideSwipeGestureResponder startSwipeRight");

		if(null == prevous) return;
		Activity thisContext = (Activity)v.getContext();
		Intent intent = new Intent();
		intent.setClass(thisContext, prevous);
		thisContext.overridePendingTransition(R.anim.push_right_out, R.anim.push_left_in);
		thisContext.startActivity(intent);
		thisContext.finish();
		
	}

	@Override
	public void startSwipeLeft(View v, Point fromEvent, Point toEvent) {
//		Log.d("DEBUG","GuideSwipeGestureResponder startSwipeLeft");
		
		if(null == next) return;
		Activity thisContext = (Activity)v.getContext();
		Intent intent = new Intent();
		intent.setClass(thisContext, next);
		thisContext.overridePendingTransition(R.anim.push_right_in, R.anim.push_left_out);
		thisContext.startActivity(intent);
		thisContext.finish();
		
	}

	@Override
	public void startSwipeUp(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void startSwipeDown(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onSwipeRight(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onSwipeLeft(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onSwipeUp(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onSwipeDown(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void startDrag(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onDrag(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void stopDrag(View v, Point fromEvent, Point toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void startZoomIn(View v, Point[] fromEvent, Point[] toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void startZoomOut(View v, Point[] fromEvent, Point[] toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onZoomIn(View v, Point[] fromEvent, Point[] toEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onZoomOut(View v, Point[] fromEvent, Point[] toEvent) {
		// TODO Auto-generated method stub
		
	}

}
